package com.example.controller;

import com.example.service.MainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class MainController {

    @Autowired
    MainService service;

    @GetMapping("/")
    public String hello(@RequestParam int SID,Model model){
        System.out.println(SID);
        model.addAttribute("student",service.getStudentBySID(SID));
        System.out.println(service.getStudentBySID(1));
        return "static/html/index";
    }

}
